package com.example.mvplogin.base;

import android.os.Bundle;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

/**
 * @param <T> T的类型为present
 */
public abstract class IBaseActivity<T extends IBasePresent> extends AppCompatActivity {
   public T present;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        present = createP();//创建present
    }

    //创建P,子类实现
    public abstract T createP();

    //回收
    public abstract void recycle();


    @Override
    protected void onDestroy() {
        super.onDestroy();
        recycle();
    }
}
